# *_* coding  : utf-8 *_*
import database

file=open("author_infomation_3.csv","rt")
title=file.readlines(1)
rows=file.readlines()
db=database.DataBase()
db.create_database("shici_1.db")
db.create_table("shici_1.db","authors",("诗人","诗人URL","朝代","诗人简介","照片URL"),("TEXT","CHAR","TEXT","TEXT","CHAR"))
i=1
for item in rows:
    
    item_s=str(item).strip('\n').replace("～","—").replace('"','')

    row=item_s.split(",",4)
    data=[]
    for text in row:
        data.append(text)

    db.incert_data_list("shici_1.db","authors",data)
    if i%100==0:
        print(i)
    i+=1
        
print("done")
